﻿using System;
using System.Data;
using System.Data.Common;
using Liger.Common;
using Liger.Data;

namespace EasyFMS.Model
{

	/// <summary>
	/// 实体类tRightGroupUser
	/// </summary>
	[Serializable]
	public class tRightGroupUser : Entity 
	{ 
		 public tRightGroupUser() 
            : base("tRightGroupUser") 
        { 

        }


		#region Model
		private int _RightUserID;
		private string _GroupCode;
		private string _UserCode;
	 
		/// <summary>
		/// 
		/// </summary>
		public int RightUserID
		{
			get{ return _RightUserID; }
			set
			{
				this.OnPropertyValueChange(_.RightUserID,_RightUserID,value);
				this._RightUserID = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string GroupCode
		{
			get{ return _GroupCode; }
			set
			{
				this.OnPropertyValueChange(_.GroupCode,_GroupCode,value);
				this._GroupCode = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string UserCode
		{
			get{ return _UserCode; }
			set
			{
				this.OnPropertyValueChange(_.UserCode,_UserCode,value);
				this._UserCode = value;
			}
		}
		#endregion

		#region Method
		/// <summary>
		/// 获取实体中的标识列
		/// </summary>
		public override Field GetIdentityField()
		{
			return _.RightUserID;
		}
		/// <summary>
		/// 获取实体中的主键列
		/// </summary>
		public override Field[] GetPrimaryKeyFields()
		{
			return new Field[] {
				_.RightUserID			};
		}
		/// <summary>
		/// 获取列信息
		/// </summary>
		public override Field[] GetFields()
		{
			return new Field[] {
				_.RightUserID,
				_.GroupCode,
				_.UserCode
			};
		}
		/// <summary>
		/// 获取值信息
		/// </summary>
		public override object[] GetValues()
		{
			return new object[] {
				_RightUserID,
				_GroupCode,
				_UserCode
			};
		} 
		/// <summary>
		/// 设置字段值
		/// </summary>
		public override void SetValue(string fieldName, object value)
        {
            switch (fieldName)
            { 
				case "RightUserID":
                    this._RightUserID = DataHelper.ConvertValue<int>(value);
                    break; 
				case "GroupCode":
                    this._GroupCode = DataHelper.ConvertValue<string>(value);
                    break; 
				case "UserCode":
                    this._UserCode = DataHelper.ConvertValue<string>(value);
                    break; 
            }
        }
		/// <summary>
		/// 获取字段值
		/// </summary>
        public override object GetValue(string fieldName)
        {
            switch (fieldName)
            { 
				case "RightUserID":
                    return this._RightUserID; 
				case "GroupCode":
                    return this._GroupCode; 
				case "UserCode":
                    return this._UserCode; 
				default :
                    return null;
            } 
        }



		#endregion

		#region _Field
		/// <summary>
		/// 字段信息
		/// </summary>
		public class _
		{
			/// <summary>
			/// * 
			/// </summary>
			public readonly static Field All = new Field("*","tRightGroupUser");
 
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field RightUserID = new Field("RightUserID","tRightGroupUser","RightUserID");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field GroupCode = new Field("GroupCode","tRightGroupUser","GroupCode");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field UserCode = new Field("UserCode","tRightGroupUser","UserCode");
		}
		#endregion

 
	}
}

